package com.honour.controller.interfaced;

import java.util.HashMap;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.honour.service.interfaced.impl.AlipayInService;
import com.system.controller.base.BaseController;
import com.system.util.AppUtil;
import com.system.util.PageData;

/**  关于支付宝支付的接口
@Function
@Author 于泓磊
@Date   2018年02月22日
*/

@Controller
@RequestMapping(value="/appalipayin")
public class AliPayInController extends BaseController{


	@Resource(name="alipayInService")
	private AlipayInService alipayInService;
	
	
	/**
	 * 
	 * @Title: getAdvertisementList   
	 * @Description: 支付宝接口回调
	 * @return   
	 * @Author: Mr.Yu   
	 * @return: Object 
	 * @Date:   2018年2月22日     
	 * @throws
	 */
	//程序执行完成后，必须打印输出success，防止支付宝服务器重复发送通知，如果不返回，则25小时内会至少通知8次
	@RequestMapping(value="/aliresponse")
	@ResponseBody
	public Object aliResponse(HttpServletResponse response){
		logBefore(logger, "支付宝接口回调");
		Map<String,Object> map = new HashMap<String,Object>();
		PageData pd = new PageData();
		pd = this.getPageData();
		String result = "00";
		try{
			System.out.println("回调pd:"+pd.toString());
		}catch (Exception e){
			logger.error(e.toString(), e);
		}finally{
			map.put("result", result);
			logAfter(logger);
		}
		return AppUtil.returnObject(new PageData(), map);
	}
}
